﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EditUser.aspx.cs" Inherits="Manage_EditUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <%
        if (Page.User.Identity.IsAuthenticated == false)
        {
            Response.Redirect("~/Manage/Default.aspx");
        }     
    %>
    
    <style type="text/css">
        table tr
        {
            height: 35px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:Literal ID="ErrorText" runat="server"></asp:Literal>
    <asp:ValidationSummary ID="EditUserValidation" runat="server" 
        ValidationGroup="EditUserValidationGroup" CssClass="failureNotification" />
    <table width="100%">
        <tr>
            <td style="text-align:right;width:100px">用户名：</td>
            <td><asp:TextBox ID="IdText" runat="server" Width="300px" />
                <asp:RequiredFieldValidator ID="IdRequired" runat="server" 
                    ControlToValidate="IdText" CssClass="failureNotification" 
                    ErrorMessage="请输入用户名。" ToolTip="请输入用户名。" 
                    ValidationGroup="EditUserValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <%if (Request.Params["uid"] == null || Request.Params["uid"] == "")
          { %>
            <tr>
                <td style="text-align:right">密码：</td>
                <td><asp:TextBox ID="PasswordText" runat="server" Width="300px" 
                        TextMode="Password" />
                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                        ControlToValidate="PasswordText" CssClass="failureNotification" 
                        ErrorMessage="请输入密码。" ToolTip="请输入密码。" 
                        ValidationGroup="EditUserValidationGroup">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="text-align:right">确认密码：</td>
                <td><asp:TextBox ID="ConfirmText" runat="server" Width="300px" 
                        TextMode="Password" />
                    <asp:CompareValidator ID="ConfirmCompare" runat="server" 
                        ControlToCompare="PasswordText" ControlToValidate="ConfirmText" 
                        CssClass="failureNotification" ErrorMessage="两次输入的密码不一致，请重新输入。" 
                        ToolTip="两次输入的密码不一致，请重新输入。" ValidationGroup="EditUserValidationGroup">*</asp:CompareValidator>
                </td>
            </tr>
        <%} %>
        <tr>
            <td style="text-align:right">用户姓名：</td>
            <td><asp:TextBox ID="NameText" runat="server" Width="300px" />
                <asp:RequiredFieldValidator ID="NameRequired" runat="server" 
                    ControlToValidate="NameText" CssClass="failureNotification" 
                    ErrorMessage="请输入用户姓名。" ToolTip="请输入用户姓名。" 
                    ValidationGroup="EditUserValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align:center">
                <asp:Button ID="SaveButton" runat="server" Text="保存" 
                    ValidationGroup="EditUserValidationGroup" onclick="SaveButton_Click" />
            </td>
        </tr>
    </table>
    <br />

    <asp:LinkButton ID="ChangePassword" runat="server" Text="更改密码" 
        onclick="ChangePassword_Click" />
</asp:Content>

